<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

//Route::get('/', function () {
//    return view('welcome');
//});

/////////用户模块
//用户注册页面
Route::get('/register', '\App\Http\Controllers\RegisterController@index');
//用户注册行为
Route::post('/register', '\App\Http\Controllers\RegisterController@register');
//用户登录
Route::get('/login', '\App\Http\Controllers\LoginController@index');
//用户登录行为
Route::post('/login', '\App\Http\Controllers\LoginController@login');
//用户登出
Route::get('/logout', '\App\Http\Controllers\LoginController@logout');
//个人设置页面
Route::get('/user/me/setting', '\App\Http\Controllers\UserController@setting');
//个人设置保存
Route::post('/user/me/setting', '\App\Http\Controllers\UserController@settingStore');


/////////文章模块
//列表展示
Route::get('/posts', '\App\Http\Controllers\PostsController@index');

//创建文章
Route::get('/posts/create', '\App\Http\Controllers\PostsController@create');




Route::post('/posts', '\App\Http\Controllers\PostsController@store');

//编辑
Route::get('/posts/{post}/edit', '\App\Http\Controllers\PostsController@edit');

//更新
Route::put('/posts/{post}', '\App\Http\Controllers\PostsController@update');

//删除
Route::get('/posts/{post}/delete', '\App\Http\Controllers\PostsController@delete');
//评论
Route::post('/posts/{post}/comment', '\App\Http\Controllers\PostsController@comment');
//赞和取消赞
Route::get('/posts/{post}/zan', '\App\Http\Controllers\PostsController@zan');
Route::get('/posts/{post}/unzan', '\App\Http\Controllers\PostsController@unzan');
//搜索列表
Route::get('/posts/search', '\App\Http\Controllers\PostsController@search');

//详情展示
Route::get('/posts/{post}', '\App\Http\Controllers\PostsController@show');

//用户中心
Route::get('/user/{user}', '\App\Http\Controllers\UserController@show');
//关注某个用户
Route::post('/user/{user}/fan', '\App\Http\Controllers\UserController@fan');
//取消关注某个用户
Route::post('/user/{user}/unfan', '\App\Http\Controllers\UserController@unfan');

//专题相关
Route::get('/topic/{topic}', '\App\Http\Controllers\TopicController@show');
Route::post('/topic/{topic}/submit', '\App\Http\Controllers\TopicController@submit');

//通知相关
Route::get('/notices', '\App\Http\Controllers\NoticeController@index');

include_once 'admin.php';
